package cn.shyouchi.wuguanjia.android.ui.attendance.statistics;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.shyouchi.wuguanjia.android.R;
import cn.shyouchi.wuguanjia.android.base.BaseActivity;
import cn.shyouchi.wuguanjia.android.widget.TopBar;

public class SignErrorInfoActivity extends BaseActivity {


    @BindView(R.id.topBar)
    TopBar mTopBar;
    @BindView(R.id.rv_attendance_error_info)
    RecyclerView mRvAttendanceErrorInfo;
    StatisticErrorAdapter mErrorAdapter;

    List<StatisticsInfoEntity.ResultMessageBean> mMessageBeen;

    @Override
    public int initContentView() {
        return R.layout.activity_sign_error_info;
    }

    @Override
    public void initInjector() {
        mMessageBeen =  getIntent().getParcelableArrayListExtra("error");

        if (mMessageBeen == null) {
            mMessageBeen = new ArrayList<>();
        }
    }

    @Override
    public void initUiAndListener() {
        ButterKnife.bind(this);
        mTopBar.setTitle(getTitle().toString());
        mTopBar.setLeftIcon(R.mipmap.ic_back);
        setSupportActionBar(mTopBar.getToolbar());

        mErrorAdapter = new StatisticErrorAdapter(mMessageBeen);
        mRvAttendanceErrorInfo.setLayoutManager(new LinearLayoutManager(mContext));
        mRvAttendanceErrorInfo.setAdapter(mErrorAdapter);

    }

    @Override
    protected boolean isApplyStatusBarTranslucency() {
        return false;
    }

    @Override
    protected boolean isApplyStatusBarColor() {
        return true;
    }

}
